package com.yn.sys.schedule;

import com.yn.sys.service.DeviceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

@Slf4j
@Service
@EnableScheduling
public class DeviceToIotSchedule {



    @Autowired
    private DeviceService deviceService;


    @Scheduled(cron = "${yn.push.data.toiot.cron}")
    public void pushDataToIot(){
        log.info("推送数据开始");
        deviceService.pushDataToIot();
        log.info("推送数据结束");
    }

}
